﻿using System;
using System.Linq;
using System.Runtime.CompilerServices;
using AutoR.Services;

namespace AutoR.Models
{
	// Token: 0x020001EB RID: 491
	public class RepairDockInfo : BasicDockInfo
	{
		// Token: 0x17000318 RID: 792
		// (get) Token: 0x06000ACD RID: 2765 RVA: 0x0006C9C7 File Offset: 0x0006ABC7
		// (set) Token: 0x06000ACE RID: 2766 RVA: 0x0006C9D0 File Offset: 0x0006ABD0
		public int shipId
		{
			[CompilerGenerated]
			get
			{
				return this.<shipId>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<shipId>k__BackingField == value)
				{
					return;
				}
				this.<shipId>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.IsEmpty);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Image);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Name);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.OutText);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.shipId);
			}
		}

		// Token: 0x17000319 RID: 793
		// (get) Token: 0x06000ACF RID: 2767 RVA: 0x0006CA29 File Offset: 0x0006AC29
		public bool IsEmpty
		{
			get
			{
				return this.shipId == 0;
			}
		}

		// Token: 0x1700031A RID: 794
		// (get) Token: 0x06000AD0 RID: 2768 RVA: 0x0006CA34 File Offset: 0x0006AC34
		// (set) Token: 0x06000AD1 RID: 2769 RVA: 0x0006CA3C File Offset: 0x0006AC3C
		public int rubdown
		{
			[CompilerGenerated]
			get
			{
				return this.<rubdown>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<rubdown>k__BackingField == value)
				{
					return;
				}
				this.<rubdown>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.rubdown);
			}
		}

		// Token: 0x1700031B RID: 795
		// (get) Token: 0x06000AD2 RID: 2770 RVA: 0x0006CA69 File Offset: 0x0006AC69
		public string Image
		{
			get
			{
				if (this.IsEmpty)
				{
					return "";
				}
				UserShip userShip = Runtime.Game.UserShip.SingleOrDefault((UserShip i) => i.id == this.shipId);
				if (userShip == null)
				{
					return null;
				}
				return userShip.SmallImage;
			}
		}

		// Token: 0x1700031C RID: 796
		// (get) Token: 0x06000AD3 RID: 2771 RVA: 0x0006CA9F File Offset: 0x0006AC9F
		public string Name
		{
			get
			{
				if (this.IsEmpty)
				{
					return "";
				}
				UserShip userShip = Runtime.Game.UserShip.SingleOrDefault((UserShip i) => i.id == this.shipId);
				if (userShip == null)
				{
					return null;
				}
				return userShip.Name;
			}
		}

		// Token: 0x1700031D RID: 797
		// (get) Token: 0x06000AD4 RID: 2772 RVA: 0x0006CAD8 File Offset: 0x0006ACD8
		public string OutText
		{
			get
			{
				if (!this.IsEmpty)
				{
					return string.Format("剩: {0:00}:{1:00}", this.Span.Hours, this.Span.Minutes);
				}
				return "空";
			}
		}

		// Token: 0x1700031E RID: 798
		// (get) Token: 0x06000AD5 RID: 2773 RVA: 0x0006CB23 File Offset: 0x0006AD23
		// (set) Token: 0x06000AD6 RID: 2774 RVA: 0x0006CB2C File Offset: 0x0006AD2C
		public TimeSpan Span
		{
			[CompilerGenerated]
			get
			{
				return this.<Span>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (TimeSpan.Equals(this.<Span>k__BackingField, value))
				{
					return;
				}
				this.<Span>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.OutText);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Span);
			}
		}
	}
}
